package cn.cvs.dao.sysUser;

import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.util.List;

@Repository
public interface SysUserMapper {
    /**
     * 增加用户信息
     * @param sysUser
     * @return
     * @throws Exception
     */
    public int add(SysUser sysUser)throws Exception;

    /**
     * 通过userCode获取User
     * @param account
     * @return
     * @throws Exception
     */
    public SysUser getLoginUser(@Param("account") String account)throws Exception;

    /**
     * 通过条件查询-userList
     * @param userName
     * @param userRole
     * @return
     * @throws Exception
     */
    public List<SysUser> selectList(String userName, int userRole, int currentPageNo, int pageSize)throws Exception;
    /**
     * 通过条件查询-用户表记录数
     * @param userName
     * @param userRole
     * @return
     * @throws Exception
     */
    public int selectCount(String userName, int userRole)throws Exception;

    /**
     * 通过userId删除user
     * @param delId
     * @return
     * @throws Exception
     */
    public int deleteUserById(Integer delId)throws Exception;


    /**
     * 通过userId获取user
     * @param id
     * @return
     * @throws Exception
     */
    public SysUser getUserById(String id)throws Exception;

    /**
     * 修改用户信息
     * @param user
     * @return
     * @throws Exception
     */
    public int modify(SysUser user)throws Exception;


    /**
     * 修改当前用户密码
     * @param id
     * @param pwd
     * @return
     * @throws Exception
     */
    public int updatePwd(int id, String pwd)throws Exception;


}
